public class ThreadDemo8 {

    public static void main(String[] args) {
        Thread t = new Thread(() -> {
            while (true) {

            }
        });

        //此时该线程是后台线程
        t.setDaemon(true);
        t.start();
    }
}
